import { createRouter, createWebHistory } from 'vue-router'
import Layout from '@/layout/Layout.vue'

const routes = [
  {
    path: '/',
    component: Layout,
    redirect: '/volunteer',
    children: [
      {
        path: '/volunteer',
        name: 'Volunteer',
        component: () => import('@/views/volunteer/VolunteerList.vue'),
        meta: {
          title: '志愿者基础信息管理'
        }
      },
      {
        path: '/activity/list',
        name: 'ActivityList',
        component: () => import('@/views/activity/ActivityList.vue'),
        meta: { title: '活动管理' }
      },
      {
        path: '/activity/record',
        name: 'ActivityRecord',
        component: () => import('@/views/activity/RecordList.vue'),
        meta: { title: '活动签到记录' }
      },
      {
        path: '/organization',
        name: 'Organization',
        component: () => import('@/views/organization/OrganizationList.vue'),
        meta: { title: '组织管理' }
      },
      {
        path: '/statistics',
        name: 'Statistics',
        component: () => import('@/views/statistics/StatisticsDashboard.vue'),
        meta: { title: '志愿服务统计分析' }
      },
      {
        path: '/feedback',
        name: 'Feedback',
        component: () => import('@/views/feedback/FeedbackList.vue'),
        meta: {
          title: '反馈管理'
        }
      },
    ]
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
